package demo_FaceObject;

class Person{
	private String name;
	private int age;

	public void setName(String name) {
		this.name = name;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public int getAge() {
		return age;
	}

	public String getInfo() {
		return "name:    " + name + "    age:    " + age;
	}
	public String getInfo(String flag){
		return "name:    " + "XXX" + "    age:    " + flag;
	}
	@Override
	public String toString() {
		return "xxxxx";
	}
}

class Student extends Person {
	private String school;

	public void setSchool(String school) {
		this.school = school;
	}

	public String getSchool() {
		return school;
	}

	public String getInfo() {
		return "name:  " + getName() +"        age:  " + getAge() + "    school:    " + school;
	}
}

public class TestOverWrite {
	public static void main(String args[]) {
		Student student = new Student();
		Person person = new Person();
		person.setName("nancy");
		person.setAge(26);
		student.setName("liupei");
		student.setAge(27);
		student.setSchool("jiaoda");
		System.out.println(person);
//		System.out.println(student.getInfo());
		
	}
}
